﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Domain;
using System.Data.Objects;
using Infrastructure;
using System.Data;
using System.Data.Objects.DataClasses;
using System.Collections;
using System.Reflection;
using DataAccess;
using DataAccess.Common;

namespace EntityFrameworkPersistent
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //PfizerDBEntities context = new PfizerDBEntities();
                //NorthwindEntities context = new NorthwindEntities();

                //Customers c = context.Customers.FirstOrDefault();


          
                //Customers c = new Customers();
                //c.CompanyName = "123";
                
                //Order o = new Order();
                //OrderDetails od = new OrderDetails();
                //OrderDetails od2 = new OrderDetails();
                //o.OrderDetails.Add(od);
                //o.OrderDetails.Add(od2);
                //c.OrderSet.Add(o);



                //EFExpert.Instance(context).FillEntityWithChildren(c);

                //EntityKey ek = (EntityKey)c.EntityKey;

                //EFDBContext efContext = new EFDBContext(UIEnum.Web, context);
                //efContext.InsertObject(c);
               
                //List<OrderDetails> ods = o.OrderDetails.ToList();

                //IEnumerable details = Reflector.GetChildren<object>(o, "OrderDetails");
                //Order o=new Order();
                //Suppliers s = new Suppliers();

                //IList<PropertyInfo> ps = EFExpert.Instance(@"C:\Northwind.txt").GetSetNavigationProperties(o);
                //IList<PropertyInfo> ps2 = EFExpert.Instance(@"C:\Northwind.txt").GetRefNavigationProperties(o);

                

                //Reflector.GetChildren<>
                //PfizerDBEntities context = new PfizerDBEntities();
                //context.AddToOrders(order);
                //context.SaveChanges();

                
            }
            catch (Exception ex)
            {
                int i = 0;
            }

        }
    }
}
